#ifndef PAGESELFTEST_H
#define PAGESELFTEST_H

#include <QWidget>
#include <QLabel>
#include "global_def.h"

namespace Ui {
class PageSelfTest;
}

class PageSelfTest : public QWidget
{
    Q_OBJECT

public:
    explicit PageSelfTest(QWidget *parent = nullptr);
    ~PageSelfTest();
    enum
    {
        OP_SELFTEST_HVS,
        OP_SELFTEST_PRO,
        OP_SELFTEST_AUX,
        OP_SELFTEST_DRV,
        OP_SELFTEST_BRK,
        OP_SELFTEST_TCMS,
        OP_SELFTEST_LCU,
        OP_SELFTEST_DOR,
        OP_SELFTEST_PIS,
        OP_SELFTEST_HVAC,
        OP_SELFTEST_LGT,
        OP_SELFTEST_FAU,
        OP_SELFTEST_DDS,
        OP_SELFTEST_RADIO,
        OP_SELFTEST_GPIS,
        OP_SELFTEST_BDS,
        OP_SELFTEST_BMS,
        OP_SELFTEST_ODS,
        OP_SELFTEST_PANMS,
        OP_SELFTEST_ICDS,
        OP_SELFTEST_TCDS,
        OP_SELFTEST_ECR
     };
    enum
    {
        OP_SELFTEST_StatcTest1_1,
        OP_SELFTEST_StatcTest2_1,
        OP_SELFTEST_StatcTest3_1,
        OP_SELFTEST_StatcTest4_1,
        OP_SELFTEST_StatcTest5_1,
        OP_SELFTEST_StatcTest6_1,
        OP_SELFTEST_StatcTest7_1,
        OP_SELFTEST_StatcTest8_1,
        OP_SELFTEST_StatcTest9_1,
        OP_SELFTEST_StatcTest10_1,
        OP_SELFTEST_StatcTest11_1,
        OP_SELFTEST_StatcTest12_1,
        OP_SELFTEST_StatcTest13_1,
        OP_SELFTEST_StatcTest14_1,
        OP_SELFTEST_StatcTest15_1,
        OP_SELFTEST_StatcTest16_1,
        OP_SELFTEST_StatcTest17_1,
        OP_SELFTEST_StatcTest18_1,
        OP_SELFTEST_StatcTest19_1,
        OP_SELFTEST_StatcTest20_1,
        OP_SELFTEST_StatcTest21_1,
        OP_SELFTEST_StatcTest22_1,
        OP_SELFTEST_StatcTest1_6,
        OP_SELFTEST_StatcTest2_6,
        OP_SELFTEST_StatcTest3_6,
        OP_SELFTEST_StatcTest4_6,
        OP_SELFTEST_StatcTest5_6,
        OP_SELFTEST_StatcTest6_6,
        OP_SELFTEST_StatcTest7_6,
        OP_SELFTEST_StatcTest8_6,
        OP_SELFTEST_StatcTest9_6,
        OP_SELFTEST_StatcTest10_6,
        OP_SELFTEST_StatcTest11_6,
        OP_SELFTEST_StatcTest12_6,
        OP_SELFTEST_StatcTest13_6,
        OP_SELFTEST_StatcTest14_6,
        OP_SELFTEST_StatcTest15_6,
        OP_SELFTEST_StatcTest16_6,
        OP_SELFTEST_StatcTest17_6,
        OP_SELFTEST_StatcTest18_6,
        OP_SELFTEST_StatcTest19_6,
        OP_SELFTEST_StatcTest20_6,
        OP_SELFTEST_StatcTest21_6,
        OP_SELFTEST_StatcTest22_6,
        OP_SELFTEST_StatcTestCnt
    };
    void setOPSelfTestStat(int sys, bool xfailed);
    void setOPStaticSelfTestFailStat(int index, bool xfailed);
    void setOPStaticSelfTestSuccessStat(int index, bool xSuccess);
    void setTCDSVisible(bool xVisible);
private slots:
    void on_Btn_Return_clicked();
signals:
    void signal_go_back();
private:
    Ui::PageSelfTest *ui;
    QList<QLabel*> m_lSysSelfTestLabels;
    QList<QLabel*> m_lSysStaticSelfTestLabels;
    QList<bool> m_lSysStaticSelfFail;
    QList<bool> m_lSysStaticSelfSuccess;
    void updateSysStaticSelfTestStat(int index);
};

#endif // PAGESELFTEST_H
